package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;

@Mapper
public interface UserMapper  {
  @Select("select *from user where openid=#{openid}")
    User slectUser(String openid);
@Options(useGeneratedKeys = true ,keyProperty = "id")
@Insert("INSERT INTO user(openid,name,create_time) values (#{openid},#{name},#{createTime})")
    void insertUser(User user);

@Select("SELECT *from user where id=#{id}")
User slectUserById(Long id);


    Integer conutMap(HashMap hashMap);
}
